import java.util.Random;

public class Lab_01 {
    public static void main(String[] args) {
        generateMathExercises(50, 100);
    }

    public static void generateMathExercises(int count, int maxRange) {
        Random random = new Random();
        System.out.println("===== Math Exercises (50 problems) =====");
        
        for (int i = 1; i <= count; i++) {
            boolean isAddition = random.nextBoolean();
            
            if (isAddition) {
                int a = random.nextInt(maxRange);
                int b = random.nextInt(maxRange - a);
                System.out.printf("%2d. %d + %d = \n", i, a, b);
            } else {
                int a = random.nextInt(maxRange);
                int b = random.nextInt(a + 1);
                System.out.printf("%2d. %d - %d = \n", i, a, b);
            }
        }
        
        System.out.println("==================================");
    }
}